package com.bjpowernode.springboot.web;


import com.bjpowernode.springboot.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {
    @RequestMapping(value = "/literal")
    public String literal(Model model){

        model.addAttribute("sex",1);
        model.addAttribute("data","SpringBoot");
        model.addAttribute("flag",true);

        User user = new User();
        user.setId(1010);
        user.setUserName("sun");
        model.addAttribute("user",user);

        User user1 = new User();
        model.addAttribute("user1",user1);
        return "literal";
    }

    @RequestMapping(value = "/join")
    public String join(Model model){
        model.addAttribute("totalRows",123);
        model.addAttribute("totalPages",13);
        model.addAttribute("currentPage",2);
        return "join";

    }
}
